$Id: PKGBUILD 89854 2013-05-03 14:50:09Z dwallace $
# Maintainer: Daniel Wallace < danielwallace at gtmanfred dot com>
# Contributor: Trizen <echo dHJpemVueEBnbWFpbC5jb20K | base64 -d>

pkgname=youtube-viewer
_pkgdir=trizen-youtube-viewer
epoch=1
pkgver=3.0.7
pkgrel=2
pkgdesc="A command line utility for viewing youtube-videos in MPlayer."
arch=('any')
url="https://github.com/trizen/youtube-viewer"
license=('GPL3')
source=("$pkgname-$pkgver.zip::https://github.com/trizen/$pkgname/zipball/$pkgver")
sha256sums=('7d8e024fdd3fcc08c3f26620403ebc9f05fb77102dce6913b61ec7ba32ccd996')

depends=('perl>=5.10.0' 'perl-data-dump' 'perl-libwww' 'perl-xml-fast')
optdepends=('vlc: for playinng videos'
			'mplayer: for playing videos'
			'perl-term-readkey: to get the terminal width size'
            'perl-term-readline-gnu: for a better STDIN support'
            'perl-lwp-protocol-https: for login and https support'
            'gcap: for retrieving Youtube closed captions. [in AUR]')


build() {
    cd "$srcdir/$_pkgdir"*/WWW-YoutubeViewer

    perl Build.PL   # --gtk-youtube-viewer
}

check(){
    cd "$srcdir/$_pkgdir"*/WWW-YoutubeViewer

    ./Build test
}

package() {
    cd "$srcdir/$_pkgdir"*/WWW-YoutubeViewer

    ./Build install --install_path script=/usr/bin --destdir=$pkgdir
    rm -r "$pkgdir/usr/lib/"

}
